<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>测试详细记录</title>
<link href="/stylesheets/survey_public.css" rel="stylesheet" type="text/css" />
<style>
#content{ width:885px; float:left;}
.content01{ width:885px; float:left; height:42px; border-bottom:1px solid #1a80d0;}
#guan{ width:190px; height:42px; line-height:42px; padding-left:112px; float:left;}
#guan li{ width:50px; float:left;}
#guan2{ width:190px; height:42px; line-height:42px; float:left;}
#guan2 li{ width:60px; float:left;}
#text{ width:114px; height:20px; border:1px solid #a5acb2; margin-top:10px;}
#guan3{ width:92px; float:right; padding-right:96px;}
#guan3 li{ width:92px; height:34px; padding:9px 0 0 0px; float:left;}

.content02{ width:860px; line-height:45px; float:left; padding-left:25px;}

.content03{ width:819px; float:left; padding:5px 0 0 68px;}
.STYLE1 {color: #FFFFFF}
.back{ width:102px; height:35px; float:right; padding-right:20px; margin-top:40px;}
#footer{ width:100%; height:200px; float:left; background:url(/images/user/report_list/footer.jpg) no-repeat; text-align:center; color:#295c72;}
#footer h1{ margin-top:100px;}
</style>
<script src="/javascripts/WebCalendar.js" type="text/javascript"></script>
<script>
 function sm(){
  var f=document.getElementById("search");
  f.submit();
  }
  
function get_page(page){
 var f=document.getElementById("search");
 var page_num=document.getElementById("page_num");
 page_num.value=page;
 f.submit();
}
</script>
</head>

<body>
<div id="page">
	<div id="header">
		<ol>
		<li><img src="/images/user/report_list/header_03.jpg" width="183" height="59" /></li>
		</ol>
		<ul>
                  <li id="org-text"> <%=current_user.name%></li>
		<li><a href="/login/logout">安全退出</a></li>
		</ul>
	</div>
    <div id="content">
    	<div class="content01">
			<form id="search" name="search" action="/user/reports/search" method="post">
    	    <%= tag(:input, :type => "hidden", :name => request_forgery_protection_token.to_s, 
                 :value => form_authenticity_token) %> 
          <input type="hidden" name="page_num" id="page_num" value="1">
          <input type="hidden" name="user_id" id="user_id"value="<%=session[CURRENT_USER_ID]%>" />
       	  <ul id="guan">
            <li>关键字:</li>
            <li><input type="text" id="text" name="keyword"  value="<%=flash[:keyword]%>" style="width:120px"/></li>
          </ul>
          <ul id="guan2">
            <li>起始日期:</li>
            <li><%= text_field 'date', 'date1', :onClick=>"SelectDate(this,'yyyy-MM-dd')" , :id=>"text",:size=>10,:value=>flash[:date1]%>	</li>
            </ul>
          <ul id="guan2">
            <li>终止日期:</li>
            <li><%= text_field 'date', 'date2', :onClick=>"SelectDate(this,'yyyy-MM-dd')" , :id=>"text" ,:size=>10,:value=>flash[:date2]%>	</li>
            </ul> 
          <ul id="guan3">
          <li><a href="#" onclick="sm();"><img src="/images/user/report_list/anniu_03.jpg" width="85" height="25"/></a></li>
          </ul>
          </form>
	  </div>
        <div class="content02">
        共有：<%=@records.total_entries%>   条测试记录
        </div>
        <div class="content03">
        <table width="729" border="0" cellpadding="0" cellspacing="0" style="border-left:1px solid #dadada; border-top:1px solid #dadada;">
  <tr>
    <td width="80"  background="/images/user/report_list/bg_03.jpg" height="36" align="center" valign="middle" style=" border-right:1px solid #dadada;"><span class="STYLE1">姓名</span></td>
    <td width="48"  background="/images/user/report_list/bg_03.jpg" height="36" align="center" style=" border-right:1px solid #dadada;"><span class="STYLE1">年龄</span></td>
    <td width="47"  background="/images/user/report_list/bg_03.jpg" height="36" align="center" style=" border-right:1px solid #dadada;"><span class="STYLE1">性别</span></td>
    <td width="222"  background="/images/user/report_list/bg_03.jpg" height="36" align="center" style=" border-right:1px solid #dadada;"><span class="STYLE1">量表</span></td>
    <td width="160"  background="/images/user/report_list/bg_03.jpg" height="36" align="center" style=" border-right:1px solid #dadada;"><span class="STYLE1">测试时间</span></td>
    <td height="36"  background="/images/user/report_list/bg_03.jpg" align="center" style=" border-right:1px solid #dadada;"><span class="STYLE1"></span></td>
  </tr>
  
  <%     @records.each do |record| %>
        	 <tr> 
          	  <td height="30" align="center" valign="middle" style="border-bottom:1px solid #dadada; border-right:1px solid #dadada;">
          	  <%= record.username %></td>
          	 <td height="30" align="center" style="border-bottom:1px solid #dadada; border-right:1px solid #dadada;">
          	  <%= record.age %></td>
          	 <td height="30" align="center" style="border-bottom:1px solid #dadada; border-right:1px solid #dadada;">
          	 <%= record.gender %></td>
          	 <td height="30" align="center" style="border-bottom:1px solid #dadada; border-right:1px solid #dadada;">
          	 <%=h truncate(record.testname , :length => 10)%></td>
             <td height="30" align="center" style="border-bottom:1px solid #dadada; border-right:1px solid #dadada;">
             <%= record.created_at.strftime('%Y年%m月%d日 %H:%M:%S')%></td>
             <td height="30" align="center" style="border-bottom:1px solid #dadada; border-right:1px solid #dadada;">
            <%= link_to '查看报告', {:id => record, :action => "show_report" }%>
            <a href="/user/reports/original_marks/<%=record.id%>">详细记录</a>
            <a onclick="return confirm('确定删除?');" href="/user/reports/destroy/<%=record.id%>">删除</a>
            </td>
            </ul>       
        <% 
          end 
        %>
</table>
  
   <div class="center03a">
      	<ul>
      	<li>
      	<% if @records.page_count > 1%>
      <div class="pagination">
      <% if params[:page_num].to_i  && params[:page_num].to_i >1%>
      <a href="#" onclick="get_page(<%=params[:page_num].to_i-1%>);"><span>上一页</span></a>|
      <% else %>
      <span>上一页|</span>
      <% end %>
      <% for i in 1..@records.page_count%>
      <% if i==params[:page_num].to_i %>
      <span>&nbsp;<%=i%>&nbsp;|</span>
      <% else %>
      <a href="#" onclick="get_page(<%=i%>);"><span>&nbsp;<%=i%>&nbsp;</span></a>|
      <% end %>
      <% end %>
      <% if params[:page_num].to_i >0&& params[:page_num].to_i < @records.page_count %>
      <a href="#" onclick="get_page(<%=params[:page_num].to_i+1%>);"><span>下一页</span></a>
      <% else %>
      <span>下一页</span>
      <% end %>
      </div>
      <% end %>
      	</li>
      	</ul>
      </div>
      </div>
        <div class="back">
               <a href="/user/test/home"><img src="/images/back.png" width="88" height="27" /></a>
        </div>
    </div>
</div>
<div id="footer">
<h1>北京心嘉源咨询有限公司 CopyRight © www.iyaoi.cn 2009</h1>
</div>
</body>
</html>
